package com.grouptemplate;

import java.io.File;

import org.beetl.core.Configuration;
import org.beetl.core.GroupTemplate;
import org.beetl.core.Template;
import org.beetl.core.resource.FileResourceLoader;

public class FilePathRL {

	public static void main(String[] args) throws Exception {

		String root = System.getProperty("user.dir")+File.separator+"template";
		File file = new File(root);
		File[] arrF = file.listFiles();
		for(int i = 0;i < arrF.length; i++ ) {
			if(arrF[i].isDirectory()) {
				System.out.println("目录名称：：" + arrF[i].getName());
			}else {
				System.out.println("文件名称：：" + arrF[i].getName());

			}
		}
		FileResourceLoader resourceLoader = new FileResourceLoader(root,"utf-8");
			Configuration cfg = Configuration.defaultConfiguration();
		GroupTemplate gt = new GroupTemplate(resourceLoader, cfg);
		Template t = gt.getTemplate("s01/hello.txt");
		String str = t.render();
		System.out.println(str);

	}
}
